<?php
/**
* @file $Id: PDFStart.fnc.php 638 2007-08-09 21:01:00Z ryness $
* @package Focus/SIS
* @copyright Copyright (C) 2006 Andrew Schmadeke. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.txt
* Focus/SIS is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.txt for copyright notices and details.
*/

function PDFStart($options="--webpage --quiet -t pdf12 --no-links --portrait --footer t --header . --left 0.5in --top 0.5in")
{
	global $htmldocPath;
	
	// If $htmldocPath is empty, produce results in HTML instead of PDF.
	if( ! empty($htmldocPath) ) {
		// Test to find out if the htmldoc package is stored and we can
		// access it using the $htmldocPath variable
		if(is_executable($htmldocPath))
		{
			$_REQUEST['_FOCUS_PDF'] = 1;
			$pdfitems['options']=$options;
			ob_start();
			return $pdfitems;
		}
		else
			ErrorMessage(array(_("PDFs cannot be produced since HTMLDOC isn't working.  Please ensure that HTMLDOC is installed and that its path is configured in config.inc.php")), 'fatal');
	} else {
		$_REQUEST['_FOCUS_PDF'] = 1;
		$pdfitems="";
		return $pdfitems;
	}
}
?>
